#ifndef DATASENSOR_H_
#define DATASENSOR_H_

#include <omnetpp.h>
//#include <list>
#include "DATAPacket_m.h"
#include "INotifiable.h"
#include "NotificationBoard.h"
#include "IPv4Address.h"
#include "InterfaceEntry.h"
#include "IInterfaceTable.h"


/*
 * @Author Hien Hoang
 * @Version Nov 27, 2013
 * */

#define DATA_TIMER 0.1


enum TIMER_TYPE {

    SEND_DATA,
};

class DataSensor : public cSimpleModule, public INotifiable {

protected:
    int status;
    int numSent;
    IInterfaceTable *ift; //Hien Hoang: For getting interface card
    InterfaceEntry *ie; //Hien Hoang: Which interface card are working on
    NotificationBoard* nb; // Notification board
    IPv4Address baseStationAddr;
    bool isUp;
    cMessage *timer;
    double xID;
//    typedef std::list<DataPacket*> WaitingList;
//    WaitingList waitingPackets;

public:
    DataSensor();
    virtual ~DataSensor();
    virtual void initialize(int stage);
    int numInitStages() const {return 5;}
    virtual void handleMessage(cMessage *msg);
    virtual void handleSelfMessage(cMessage *msg);
    virtual void startSending();
    virtual void stopSending();
    virtual void waitSending();
    virtual void continueSending();
    virtual void cancelTimer();
    virtual void scheduleTimer(TIMER_TYPE type);
    void receiveChangeNotification(int category, const cObject *details);

};

#endif /* DATASENSOR_H_ */
